#ifndef PANELTREEITEM_H
#define PANELTREEITEM_H

#include "PanelItem.h"

class GraphicsButton;
class EntryItem;
class WOP_Entry;

#define PLUSICON "images/plus.png"
#define MINUSICON "images/minus.png"

class PanelTreeItem : public PanelItem
{
	Q_OBJECT

public:
	PanelTreeItem(std::string name, AbstractManager* manager, AbstractPanel* panel);
	~PanelTreeItem();
	int getlevel();
	GraphicsButton* getIcon();
	int indexOfChild(EntryItem*);
	void coumputelevel();
	void setParent(PanelItem*);
	void setIsUnfold(bool);
	bool isUnfold();
	void hideUnfoldIcon();

public slots:
	void clickUnfoldButton();

protected:
	GraphicsButton* _unfoldButton;
	int _level;
	bool _isUnfold;
	std::vector<EntryItem*> _children;
	void setChildrenVisible(bool);
	void initUnfoldButton();
	virtual void unfold(bool)=0;
	virtual void drawType( QPainter * painter );
};

#endif // PANELTREEITEM_H
